package Year22_Month06.day26;
import java.util.*;

public class 组队竞赛 {
    public static void main(String[] args){
        Scanner sc  = new Scanner(System.in);
        int n = sc.nextInt();//用来接收组数
        int[] arr = new int[n * 3];
        for(int i = 0;i < 3 * n; i++){
            arr[i] = sc.nextInt();
        }
        Arrays.sort(arr);
        int sum = 0;
        for(int i = 0;n + 2 * i < n * 3;i++){
            sum += arr[n + 2 * i];
        }
        System.out.println(sum);
    }
}
